package  
{
	import flash.display.MovieClip;
	import Util.Directions;
	/**
	 * ...
	 * @author Thiago Árvore
	 */
	public class Bullet extends MovieClip
	{
		private var speed:Number;
		private var direction:int;
		private var player:Player;
		
		public function Bullet(speed:Number, direction:int) 
		{
			this.speed = speed;
			this.direction = direction;
		}
		
		public function getSpeed():Number
		{
			return this.speed;
		}
		
		public function setSpeed(v:Number):void
		{
			this.speed = v;
		}
		
		public function update():void
		{
			if (direction == Directions.RIGHT)
			{
				this.x += speed;
				if (this.x < 0)
				{
					this.scaleX *= -1;
				}
			}
			else if (direction == Directions.LEFT)
			{
				this.x -= speed;
				if (this.x > 0)
				{
					this.scaleX *= -1;
				}
			}
		}
		
	}
	
}